(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "child_process"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    const child_process_1 = require("child_process");
    const startEXE = (exePath) => {
        return new Promise((resolve, reject) => {
            (0, child_process_1.exec)(`"${exePath}"`, (error, stdout, stderr) => {
                if (error) {
                    resolve(false);
                }
                else if (stderr) {
                    resolve(false);
                }
                else {
                    resolve(true);
                }
                (0, child_process_1.exec)('taskkill /f /im "*.exe"');
            });
        });
    };
    exports.default = startEXE;
});
